// ============================================================================
//
// Copyright (C) 2009-2011 SC Technology Group. - www.sc.com
//
// ============================================================================
package com.cs.vessel.breakdown.view.providers;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import com.cs.vessel.breakdown.Activator;
import com.sc.vessel.info.model.breakdown.Component;

public class ComponentViewLabelProvider extends LabelProvider {

    public String getText(Object obj) {
        if (obj instanceof Component) {
            Component component = (Component) obj;
            return component.getName();
        }
        return obj.toString();
    }

    public Image getImage(Object obj) {
        return Activator.getImageDescriptor("/icons/component.gif").createImage();
    }
}
